package com.footinteraction;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class SignalDBHelper extends SQLiteOpenHelper {
	public static int DB_VERSION = 1;
	
	public static String DB_FILE_NAME = "signals.db";
	public static String TABLE_NAME = "signals";
	public static String KEY_ID = "_id";
	public static String KEY_SIGNAL = "signal";

	public static String DATABASE_CRAEATE = "create table IF NOT EXISTS "
			+ TABLE_NAME + " (" + KEY_ID
			+ " integer primary key autoincrement, " + KEY_SIGNAL + " text);";
	
	public SignalDBHelper(Context context){
		super(context, DB_FILE_NAME, null, DB_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL(DATABASE_CRAEATE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
		onCreate(db);
	}
}
